﻿using Microsoft.Win32;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace HML.SkinTool
{
    public partial class SkinForm8_0_0_6 : Form
    {
        public SkinForm8_0_0_6()
        {
            InitializeComponent();
        }

        private void SkinForm8_0_0_6_Load(object sender, EventArgs e)
        {
            #region paginationBar

            this.paginationBar1.SetPagination(5, 200, 10, 6);
            this.paginationBar2.SetPagination(5, 200, 10, 6);
            this.paginationBar3.SetPagination(5, 200, 10, 6);
            this.paginationBar4.SetPagination(5, 200, 10, 6);

            #endregion

            #region   stepProgress

            this.stepProgress1.CompletionIndex = 3;
            this.stepProgress2.CompletionIndex = 3;
            this.stepProgress3.CompletionIndex = 3;
            this.stepProgress4.CompletionIndex = 3;

            #endregion

            #region DropDownListPlus

            string[] textArr1 = GetLists();
            DropDownListPlusItemCollection list1 = new DropDownListPlusItemCollection();
            for (int i = 0; i < textArr1.Length; i++)
            {
                list1.Add(new DropDownListPlusItem() { Text = textArr1[i], Enabled = !(i == 3 || i == 5 || i == 6) });
            }
            this.dropDownListPlus1.BindItemsSource(list1, new List<DropDownListPlusItem> { list1[1], list1[3], list1[5] });

            string[] textArr2 = GetLists();
            DropDownListPlusItemCollection list2 = new DropDownListPlusItemCollection();
            for (int i = 0; i < textArr2.Length; i++)
            {
                list2.Add(new DropDownListPlusItem() { Text = textArr2[i], Enabled = !(i == 3 || i == 5 || i == 6) });
            }
            this.dropDownListPlus2.BindItemsSource(list2, new List<DropDownListPlusItem> { list2[1], list2[3], list2[5] });

            string[] textArr3 = GetLists();
            DropDownListPlusItemCollection list3 = new DropDownListPlusItemCollection();
            for (int i = 0; i < textArr3.Length; i++)
            {
                list3.Add(new DropDownListPlusItem() { Text = textArr3[i], Enabled = !(i == 3 || i == 5 || i == 6) });
            }
            this.dropDownListPlus3.BindItemsSource(list3, new List<DropDownListPlusItem> { list3[1], list3[3], list3[5] });

            string[] textArr4 = GetLists();
            DropDownListPlusItemCollection list4 = new DropDownListPlusItemCollection();
            for (int i = 0; i < textArr4.Length; i++)
            {
                list4.Add(new DropDownListPlusItem() { Text = textArr4[i], Enabled = !(i == 3 || i == 5 || i == 6) });
            }
            this.dropDownListPlus4.BindItemsSource(list4, new List<DropDownListPlusItem> { list4[1], list4[3], list4[5] });

            #endregion

            #region pieceProgress1

            this.pieceProgress1.PieceSize = 8;
            this.pieceProgress1.PieceAmount = 100;
            this.pieceProgress1.SetAllPieceStatus(PieceProgressStatus.Normal);
            this.pieceProgress1.SetPieceStatus(this.errorArr, PieceProgressStatus.Error);
            this.pieceProgress1.SetPieceStatus(this.successArr, PieceProgressStatus.Success);
            this.pieceProgress1.SetPieceStatus(this.handleArr, PieceProgressStatus.Executing);

            this.pieceProgress2.PieceSize = 8;
            this.pieceProgress2.PieceAmount = 100;
            this.pieceProgress2.SetAllPieceStatus(PieceProgressStatus.Normal);
            this.pieceProgress2.SetPieceStatus(this.errorArr, PieceProgressStatus.Error);
            this.pieceProgress2.SetPieceStatus(this.successArr, PieceProgressStatus.Success);
            this.pieceProgress2.SetPieceStatus(this.handleArr, PieceProgressStatus.Executing);

            #endregion

            #region commandButton

            this.commandButton1.SelectedCommand = this.commandButton1.Commands[1];
            this.commandButton8.SelectedCommand = this.commandButton8.Commands[1];

            #endregion

            #region breadcrumbBar

            this.breadcrumbBar1.SelectedItem = this.breadcrumbBar1.Items[1];
            this.breadcrumbBar2.SelectedItem = this.breadcrumbBar2.Items[1];
            this.breadcrumbBar3.SelectedItem = this.breadcrumbBar3.Items[1];
            this.breadcrumbBar4.SelectedItem = this.breadcrumbBar4.Items[1];

            this.breadcrumbBar5.SelectedItem = this.breadcrumbBar1.Items[1];
            this.breadcrumbBar6.SelectedItem = this.breadcrumbBar2.Items[1];
            this.breadcrumbBar7.SelectedItem = this.breadcrumbBar3.Items[1];
            this.breadcrumbBar8.SelectedItem = this.breadcrumbBar4.Items[1];
            #endregion

            #region ImageSlide

            this.GetImageSlideItems(this.imageSlide1);
            this.GetImageSlideItems(this.imageSlide2);
            this.GetImageSlideItems(this.imageSlide3);
            this.GetImageSlideItems(this.imageSlide4);

            #endregion
        }

        private void GetImageSlideItems(ImageSlide imageSlide)
        {
            imageSlide.AutoSuspend = false;
            imageSlide.Orientation = ImageSlideOrientation.RightToLeft;
            imageSlide.TitleBar.Visible = true;
            imageSlide.NavigationBar.Visible = ImageSlideNavigationBarVisibility.Always;
            imageSlide.LegendsBar.Visible = true;

            imageSlide.Items.Add(new ImageSlideItem() { Image = global::HML.SkinTool.Properties.Resources.Control_ImageSlide_Image_1, Text = "唧唧复唧唧，木兰当户织。" });
            imageSlide.Items.Add(new ImageSlideItem() { Image = global::HML.SkinTool.Properties.Resources.Control_ImageSlide_Image_2, Text = "不闻机杼声，唯闻女叹息。" });
            imageSlide.Items.Add(new ImageSlideItem() { Image = global::HML.SkinTool.Properties.Resources.Control_ImageSlide_Image_3, Text = "问女何所思，问女何所忆。" });
            imageSlide.Items.Add(new ImageSlideItem() { Image = global::HML.SkinTool.Properties.Resources.Control_ImageSlide_Image_4, Text = "女亦无所思，女亦无所忆。" });
            imageSlide.Items.Add(new ImageSlideItem() { Image = global::HML.SkinTool.Properties.Resources.Control_ImageSlide_Image_5, Text = "昨夜见军帖，可汗大点兵，" });
            imageSlide.Items.Add(new ImageSlideItem() { Image = global::HML.SkinTool.Properties.Resources.Control_ImageSlide_Image_6, Text = "军书十二卷，卷卷有爷名。" });
            imageSlide.Items.Add(new ImageSlideItem() { Image = global::HML.SkinTool.Properties.Resources.Control_ImageSlide_Image_7, Text = "阿爷无大儿，木兰无长兄，" });
            imageSlide.Items.Add(new ImageSlideItem() { Image = global::HML.SkinTool.Properties.Resources.Control_ImageSlide_Image_8, Text = "愿为市鞍马，从此替爷征。" });

        }

        /// <summary>
        /// 获取List的Demo数据集合
        /// </summary>
        /// <returns></returns>
        public static string[] GetLists()
        {
            string str = @"
唧唧复唧唧，木兰当户织。
不闻机杼声，唯闻女叹息。 
问女何所思，问女何所忆。
女亦无所思，女亦无所忆。
昨夜见军帖，可汗大点兵，
军书十二卷，卷卷有爷名。
阿爷无大儿，木兰无长兄，
愿为市鞍马，从此替爷征。 
东市买骏马，西市买鞍鞯，
南市买辔头，北市买长鞭。
旦辞爷娘去，暮宿黄河边，
不闻爷娘唤女声，但闻黄河流水鸣溅溅。
旦辞黄河去，暮至黑山头，
不闻爷娘唤女声，但闻燕山胡骑鸣啾啾。 
万里赴戎机，关山度若飞。
朔气传金柝，寒光照铁衣。
将军百战死，壮士十年归。 
归来见天子，天子坐明堂。
策勋十二转，赏赐百千强。
可汗问所欲，木兰不用尚书郎，
愿驰千里足，送儿还故乡。
爷娘闻女来，出郭相扶将；
阿姊闻妹来，当户理红妆；
小弟闻姊来，磨刀霍霍向猪羊。
开我东阁门，坐我西阁床，
脱我战时袍，著我旧时裳。
当窗理云鬓，对镜帖花黄。
出门看火伴，火伴皆惊忙，
同行十二年，不知木兰是女郎。";
            return str.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
        }

        private int[] errorArr = new int[] { 3, 23, 16, 20, 34, 35, 38, 50, 57, 59, 65, 68, 69, 70 };
        private int[] successArr = new int[] { 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
        private int[] handleArr = new int[] { 71, 72, 73, 74, 75 };

    }

}
